package com.abner.juc.util;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * 堵塞队列
 * @author Abner
 */
public class BlockingQueueDemo {
    public static void main(String[] args) {
        ArrayBlockingQueue<Object> queue = new ArrayBlockingQueue<>(3);
        System.out.println(queue.add("a"));
        System.out.println(queue.add("b"));
        System.out.println(queue.add("c"));
        //队列先进先出 所以删除先进的
        System.out.println(queue.remove());
    }
}
